class UserIncomeModel {
  String? totalAmount; // 可提现收益
  String? totalIncomeAmount; // 累计收益总额
  String? totalPayUserCount; // 累计付费用户
  String? totalInviteUserCount; // 累计推广用户
  String? todayInviteUserCount; // 今日推广用户
  String? monthInviteUserCount; // 当月推广用户
  String? monthIncomeAmount; // 当月推广收益金币
  String? todayIncomeAmount; // 今日推广收益金币

  //TODO: 待数据更新
  String? monthIncomePerformance; // 当月推广业绩金币
  String? todayIncomePerformance; // 今日推广业绩金币
  String? totalInviteNextProxy; // 直推下级代理 

  UserIncomeModel({
    this.totalAmount,
    this.totalIncomeAmount,
    this.totalPayUserCount,
    this.totalInviteUserCount,
    this.todayInviteUserCount,
    this.todayIncomeAmount,
    this.monthInviteUserCount,
    this.monthIncomeAmount,
    this.monthIncomePerformance,
    this.todayIncomePerformance,
    this.totalInviteNextProxy,
  });

  UserIncomeModel.fromJson(Map<String, dynamic> json) {
    totalAmount = json['totalAmount'];
    totalIncomeAmount = json['totalIncomeAmount'];
    totalPayUserCount = json['totalPayUserCount'];
    totalInviteUserCount = json['totalInviteUserCount'];
    todayInviteUserCount = json['todayInviteUserCount'];
    todayIncomeAmount = json['todayIncomeAmount'];
    monthInviteUserCount = json['monthInviteUserCount'];
    monthIncomeAmount = json['monthIncomeAmount'];
    monthIncomePerformance = json['monthIncomePerformance'];
    todayIncomePerformance = json['todayIncomePerformance'];
    totalInviteNextProxy = json['totalInviteNextProxy'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['totalAmount'] = this.totalAmount;
    data['totalIncomeAmount'] = this.totalIncomeAmount;
    data['totalPayUserCount'] = this.totalPayUserCount;
    data['totalInviteUserCount'] = this.totalInviteUserCount;
    data['todayInviteUserCount'] = this.todayInviteUserCount;
    data['todayIncomeAmount'] = this.todayIncomeAmount;
    data['monthInviteUserCount'] = this.monthInviteUserCount;
    data['monthIncomeAmount'] = this.monthIncomeAmount;
    data['totalInviteNextProxy'] = this.totalInviteNextProxy;
    return data;
  }
}

class InviteIncomeModel {
  int? totalInvites;
  int? todayInvites;
  int? totalInviteAmount;
  int? todayInviteAmount;
  int? total;
  bool? hasNext;
  List<InviteItem>? inviteItemList;

  InviteIncomeModel(
      {this.totalInvites,
      this.todayInvites,
      this.totalInviteAmount,
      this.todayInviteAmount,
      this.total,
      this.hasNext,
      this.inviteItemList});

  InviteIncomeModel.fromJson(Map<String, dynamic> json) {
    totalInvites = json['totalInvites'];
    todayInvites = json['todayInvites'];
    totalInviteAmount = json['totalInviteAmount'];
    todayInviteAmount = json['todayInviteAmount'];
    total = json['total'];
    hasNext = json['hasNext'];
    if (json['list'] != null) {
      inviteItemList = <InviteItem>[];
      json['list'].forEach((v) {
        inviteItemList?.add(new InviteItem.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['totalInvites'] = this.totalInvites;
    data['todayInvites'] = this.todayInvites;
    data['totalInviteAmount'] = this.totalInviteAmount;
    data['todayInviteAmount'] = this.todayInviteAmount;
    data['total'] = this.total;
    data['hasNext'] = this.hasNext;
    if (this.inviteItemList != null) {
      data['list'] = this.inviteItemList?.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class InviteItem {
  int? userId;
  String? userName;
  int? incomeAmount;
  double? incomeRate;
  String? rechargeAt;

  InviteItem({this.userId, this.userName, this.incomeAmount, this.incomeRate, this.rechargeAt});

  InviteItem.fromJson(Map<String, dynamic> json) {
    userId = json['userId'];
    userName = json['userName'];
    incomeAmount = json['incomeAmount'];
    incomeRate = json['incomeRate'];
    rechargeAt = json['rechargeAt'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['userId'] = this.userId;
    data['userName'] = this.userName;
    data['incomeAmount'] = this.incomeAmount;
    data['incomeRate'] = this.incomeRate;
    data['rechargeAt'] = this.rechargeAt;
    return data;
  }
}
